package com.itheima.fanshe;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/*
拿到了类的字节码文件
使用未知的类  反射
 */
public class Demo {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException, InvocationTargetException, ClassNotFoundException {

       /* Test test = new Test();
        test.sing();*/
        Class<?> clazz = Class.forName("com.itheima.fanshe.Test");
        Method[] declaredMethods = clazz.getDeclaredMethods();
        for (Method method : declaredMethods) {
             method.invoke(clazz.newInstance());

        }

    }
}
